/*
 * @Description: 
 * @Autor: zhangbing
 * @Date: 2021-06-16 11:30:32
 * @LastEditors: zhangbing
 * @LastEditTime: 2021-06-17 16:27:53
 */


const { Base64 } = require('js-base64')

let a = '1'
let b = '2'
let c = a || b
console.log(c);
let encodeParam = Base64.encode(c)
console.log('encodeParam',encodeParam);
console.log(Base64.encode('1'));

console.log(Base64.encode(a || b));

// let latin = 'dankogai'
// let utf8 = '小飼弾'
// let u8s = new Uint8Array([100, 97, 110, 107, 111, 103, 97, 105])

// Base64.encode(latin) // ZGFua29nYWk=
// Base64.encode(latin, true) // ZGFua29nYWk skips padding
// Base64.encodeURI(latin) // ZGFua29nYWk
// Base64.btoa(latin) // ZGFua29nYWk=
// Base64.btoa(utf8) // raises exception
// Base64.fromUint8Array(u8s) // ZGFua29nYWk=
// Base64.fromUint8Array(u8s, true) // ZGFua29nYW which is URI safe
// Base64.encode(utf8) // 5bCP6aO85by+
// Base64.encode(utf8, true) // 5bCP6aO85by-
// Base64.encodeURI(utf8)

// console.log(Base64.encode(latin))

// Base64.decode('ZGFua29nYWk=') // dankogai
// Base64.decode('ZGFua29nYWk') // dankogai
// Base64.atob('ZGFua29nYWk=') // dankogai
// Base64.atob('5bCP6aO85by+') // 'å°�é£¼å¼¾' which is nonsense
// Base64.toUint8Array('ZGFua29nYWk=') // u8s above
// Base64.decode('5bCP6aO85by+') // 小飼弾
// // note .decodeURI() is unnecessary since it accepts both flavors
// Base64.decode('5bCP6aO85by-') // 小飼弾

// console.log(Base64.decode('ZGFua29nYWk='))

// console.log('jdhapp270', Base64.encodeURI('jdhapp270'))
// console.log('amRoYXBwMjcw', Base64.decode('amRoYXBwMjcw'))

// console.log('加密', Base64.encodeURI('jd_66e9faa0ae625'))
// console.log('解密', Base64.decode('amRfNjZlOWZhYTBhZTYyNSZhbXA'))

// console.log('解密', Base64.decode('%E8%B4%A8%E9%87%8F%E6%95%88%E8%83%BD021'))

// console.log('加密', Base64.encode('张兵'))

// console.log('加密', Base64.encodeURI('jd_66e9faa0ae625')); // amRfNjZlOWZhYTBhZTYyNQ
